
#include "IClassChar.h"
#include "member_BClass.h"

using namespace BWE;

ClassChar::ClassChar() : BClass("char", true)
{
	
	insertMethod("char()", &ClassChar::create);
	insertMethod("char(char)", &ClassChar::create_char);
	insertMethod("char(short)", &ClassChar::create_short);
	insertMethod("char(int)", &ClassChar::create_int);
	insertMethod("char(long)", &ClassChar::create_long);
	insertMethod("char(real)", &ClassChar::create_real);
	insertMethod("char(float)", &ClassChar::create_float);
	insertMethod("char(double)", &ClassChar::create_double);
	insertMethod("~char()", &ClassChar::release);

	insertMethod("char =(bool)", &ClassChar::assign_bool);
	insertMethod("char =(char)", &ClassChar::assign_char);
	insertMethod("char =(short)", &ClassChar::assign_short);
	insertMethod("char =(long)", &ClassChar::assign_long);
	insertMethod("char =(real)", &ClassChar::assign_real);
	insertMethod("char =(float)", &ClassChar::assign_float);
	insertMethod("char =(double)", &ClassChar::assign_double);

	insertMethod("char +()", &ClassChar::positive);
	insertMethod("char -()", &ClassChar::negative);
	insertMethod("char ++()", &ClassChar::plus_plus);
	insertMethod("char --()", &ClassChar::minus_minus);

	insertMethod("char +(char)", &ClassChar::plus_char);
	insertMethod("short +(short)", &ClassChar::plus_short);
	insertMethod("int +(int)", &ClassChar::plus_int);
	insertMethod("long +(long)", &ClassChar::plus_long);
	insertMethod("long +(real)", &ClassChar::plus_real);
	insertMethod("float +(float)", &ClassChar::plus_float);
	insertMethod("double +(double)", &ClassChar::plus_double);

	insertMethod("+=(char)", &ClassChar::plus_assign_char);
	insertMethod("+=(short)", &ClassChar::plus_assign_short);
	insertMethod("+=(int)", &ClassChar::plus_assign_int);
	insertMethod("+=(long)", &ClassChar::plus_assign_long);
	insertMethod("+=(real)", &ClassChar::plus_assign_real);
	insertMethod("+=(float)", &ClassChar::plus_assign_float);
	insertMethod("+=(double)", &ClassChar::plus_assign_double);

	insertMethod("int -(char)", &ClassChar::minus_char);
	insertMethod("int -(short)", &ClassChar::minus_short);
	insertMethod("int -(int)", &ClassChar::minus_int);
	insertMethod("long -(long)", &ClassChar::minus_long);
	insertMethod("long -(real)", &ClassChar::minus_real);
	insertMethod("float -(float)", &ClassChar::minus_float);
	insertMethod("double -(double)", &ClassChar::minus_double);

	insertMethod("-=(char)", &ClassChar::minus_assign_char);
	insertMethod("-=(short)", &ClassChar::minus_assign_short);
	insertMethod("-=(int)", &ClassChar::minus_assign_int);
	insertMethod("-=(long)", &ClassChar::minus_assign_long);
	insertMethod("-=(real)", &ClassChar::minus_assign_real);
	insertMethod("-=(float)", &ClassChar::minus_assign_float);
	insertMethod("-=(double)", &ClassChar::minus_assign_double);

	insertMethod("int %(char)",		 &ClassChar::mod_char);
	insertMethod("int %(short)",	 &ClassChar::mod_short);
	insertMethod("int %(int)",		 &ClassChar::mod_int);
	insertMethod("long %(long)",	 &ClassChar::mod_long);
	insertMethod("long %(real)",	 &ClassChar::mod_real);
	insertMethod("float %(float)",	 &ClassChar::mod_float);
	insertMethod("double %(double)", &ClassChar::mod_double);

	insertMethod("%=(char)",	&ClassChar::mod_assign_char);
	insertMethod("%=(short)",	&ClassChar::mod_assign_short);
	insertMethod("%=(int)",		&ClassChar::mod_assign_int);
	insertMethod("%=(long)",	&ClassChar::mod_assign_long);
	insertMethod("%=(real)",	&ClassChar::mod_assign_real);
	insertMethod("%=(float)",	&ClassChar::mod_assign_float);
	insertMethod("%=(double)",	&ClassChar::mod_assign_double);

	insertMethod("bool ==(bool)", &ClassChar::equal_bool);
	insertMethod("bool ==(char)", &ClassChar::equal_char);
	insertMethod("bool ==(short)", &ClassChar::equal_short);
	insertMethod("bool ==(int)", &ClassChar::equal_int);
	insertMethod("bool ==(long)", &ClassChar::equal_long);
	insertMethod("bool ==(real)", &ClassChar::equal_real);
	insertMethod("bool ==(float)", &ClassChar::equal_float);
	insertMethod("bool ==(double)", &ClassChar::equal_double);

	insertMethod("bool !=(bool)", &ClassChar::unequal_bool);
	insertMethod("bool !=(char)", &ClassChar::unequal_char);
	insertMethod("bool !=(short)", &ClassChar::unequal_short);
	insertMethod("bool !=(int)", &ClassChar::unequal_int);
	insertMethod("bool !=(long)", &ClassChar::unequal_long);
	insertMethod("bool !=(real)", &ClassChar::unequal_real);
	insertMethod("bool !=(float)", &ClassChar::unequal_float);
	insertMethod("bool !=(double)", &ClassChar::unequal_double);

	insertMethod("bool >(char)", &ClassChar::greater_char);
	insertMethod("bool >(short)", &ClassChar::greater_short);
	insertMethod("bool >(int)", &ClassChar::greater_int);
	insertMethod("bool >(long)", &ClassChar::greater_long);
	insertMethod("bool >(real)", &ClassChar::greater_real);
	insertMethod("bool >(float)", &ClassChar::greater_float);
	insertMethod("bool >(double)", &ClassChar::greater_double);

	insertMethod("bool <(char)", &ClassChar::less_char);
	insertMethod("bool <(short)", &ClassChar::less_short);
	insertMethod("bool <(int)", &ClassChar::less_int);
	insertMethod("bool <(long)", &ClassChar::less_long);
	insertMethod("bool <(real)", &ClassChar::less_real);
	insertMethod("bool <(float)", &ClassChar::less_float);
	insertMethod("bool <(double)", &ClassChar::less_double);

	insertMethod("bool >=(char)", &ClassChar::greater_equal_char);
	insertMethod("bool >=(short)", &ClassChar::greater_equal_short);
	insertMethod("bool >=(int)", &ClassChar::greater_equal_int);
	insertMethod("bool >=(long)", &ClassChar::greater_equal_long);
	insertMethod("bool >=(real)", &ClassChar::greater_equal_real);
	insertMethod("bool >=(float)", &ClassChar::greater_equal_float);
	insertMethod("bool >=(double)", &ClassChar::greater_equal_double);

	insertMethod("bool <=(char)", &ClassChar::less_equal_char);
	insertMethod("bool <=(short)", &ClassChar::less_equal_short);
	insertMethod("bool <=(int)", &ClassChar::less_equal_int);
	insertMethod("bool <=(long)", &ClassChar::less_equal_long);
	insertMethod("bool <=(real)", &ClassChar::less_equal_real);
	insertMethod("bool <=(float)", &ClassChar::less_equal_float);
	insertMethod("bool <=(double)", &ClassChar::less_equal_double);
}

void ClassChar::create(int argc, BValue* argv)
{
	argv[0].refer() = 0;
}
void ClassChar::create_char(int argc, BValue* argv)
{
	char c = argv[1];
	argv[0].refer() = c;
}
void ClassChar::create_short(int argc, BValue* argv)
{
	short s = argv[1];
	argv[0].refer() = (char)s;
}
void ClassChar::create_int(int argc, BValue* argv)
{
	int i = argv[1];
	argv[0].refer() = (char)i;
}
void ClassChar::create_long(int argc, BValue* argv)
{
	long long l = argv[1];
	argv[0].refer() = (char)l;
}
void ClassChar::create_real(int argc, BValue* argv)
{
	BReal r = argv[1];
	argv[0].refer() = (char)r;
}
void ClassChar::create_float(int argc, BValue* argv)
{
	float f = argv[1];
	argv[0].refer() = (char)f;
}
void ClassChar::create_double(int argc, BValue* argv)
{
	double d = argv[1];
	argv[0].refer() = (char)d;
}
void ClassChar::release(int argc, BValue* argv)
{
	argv[0].refer().clear();
}

void ClassChar::assign_bool(int argc, BValue* argv)
{
	bool b = argv[1];
	argv[0] = b ? 1 : 0;
}
void ClassChar::assign_char(int argc, BValue* argv)
{
	char c = argv[1];
	argv[0] = c;
}
void ClassChar::assign_short(int argc, BValue* argv)
{
	short s = argv[1];
	argv[0] = (char)s;
}
void ClassChar::assign_int(int argc, BValue* argv)
{
	int i = argv[1];
	argv[0] = (char)i;
}
void ClassChar::assign_long(int argc, BValue* argv)
{
	long long f = argv[1];
	argv[0] = (char)f;
}
void ClassChar::assign_real(int argc, BValue* argv)
{
	BReal r = argv[1];
	argv[0] = (char)r;
}
void ClassChar::assign_float(int argc, BValue* argv)
{
	int f = argv[1];
	argv[0] = (char)f;
}
void ClassChar::assign_double(int argc, BValue* argv)
{
	double d = argv[1];
	argv[0] = (char)d;
}

void ClassChar::positive(int argc, BValue* argv)
{

}
void ClassChar::negative(int argc, BValue* argv)
{
	char& v = argv[0];
	argv[0] = -v;
}
void ClassChar::plus_plus(int argc, BValue* argv)
{
	char& v = argv[0];
	argv[0] = v++;
}
void ClassChar::minus_minus(int argc, BValue* argv)
{
	char& v = argv[0];
	argv[0] = v--;
}

void ClassChar::plus_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v + c);
}
void ClassChar::plus_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v + s);
}
void ClassChar::plus_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v + i);
}
void ClassChar::plus_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v + l);
}
void ClassChar::plus_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v + r);
}
void ClassChar::plus_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v + f);
}
void ClassChar::plus_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v + d);
}

void ClassChar::plus_assign_char(int argc, BValue* argv)
{
	char& v = argv[0];
	char c = argv[1];
	v = v + c;
}
void ClassChar::plus_assign_short(int argc, BValue* argv)
{
	char& v = argv[0];
	short s = argv[1];
	v = (char)(v + s);
}
void ClassChar::plus_assign_int(int argc, BValue* argv)
{
	char& v = argv[0];
	int i = argv[1];
	v = (char)(v + i);
}
void ClassChar::plus_assign_long(int argc, BValue* argv)
{
	char& v = argv[0];
	long long l = argv[1];
	v = (char)(v + l);
}
void ClassChar::plus_assign_real(int argc, BValue* argv)
{
	char& v = argv[0];
	BReal r = argv[1];
	v = (char)(v + r);
}
void ClassChar::plus_assign_float(int argc, BValue* argv)
{
	char& v = argv[0];
	float f = argv[1];
	v = (char)(v + f);
}
void ClassChar::plus_assign_double(int argc, BValue* argv)
{
	char& v = argv[0];
	double d = argv[1];
	v = (char)(v + d);
}

void ClassChar::minus_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v - c);
}
void ClassChar::minus_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v - s);
}
void ClassChar::minus_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v - i);
}
void ClassChar::minus_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v - l);
}
void ClassChar::minus_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v - r);
}
void ClassChar::minus_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v - f);
}
void ClassChar::minus_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v - d);
}

void ClassChar::minus_assign_char(int argc, BValue* argv)
{
	char& v = argv[0];
	char c = argv[1];
	v = v - c;
}
void ClassChar::minus_assign_short(int argc, BValue* argv)
{
	char& v = argv[0];
	short s = argv[1];
	v = (char)(v - s);
}
void ClassChar::minus_assign_int(int argc, BValue* argv)
{
	char& v = argv[0];
	int i = argv[1];
	v = (char)(v - i);
}
void ClassChar::minus_assign_long(int argc, BValue* argv)
{
	char& v = argv[0];
	long long l = argv[1];
	v = (char)(v - l);
}
void ClassChar::minus_assign_real(int argc, BValue* argv)
{
	char& v = argv[0];
	BReal r = argv[1];
	v = (char)(v - r);
}
void ClassChar::minus_assign_float(int argc, BValue* argv)
{
	char& v = argv[0];
	float f = argv[1];
	v = (char)(v - f);
}
void ClassChar::minus_assign_double(int argc, BValue* argv)
{
	char& v = argv[0];
	double d = argv[1];
	v = (char)(v - d);
}

void ClassChar::mod_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (char)(v % c);
}
void ClassChar::mod_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (char)(v % s);
}
void ClassChar::mod_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (char)(v % i);
}
void ClassChar::mod_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (char)(v % l);
}
void ClassChar::mod_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (char)(v % (int)r);
}
void ClassChar::mod_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (char)(v % (int)f);
}
void ClassChar::mod_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (char)(v % (int)d);
}

void ClassChar::mod_assign_char(int argc, BValue* argv)
{
	char& v = argv[0];
	char c = argv[1];
	v = v - c;
}
void ClassChar::mod_assign_short(int argc, BValue* argv)
{
	char& v = argv[0];
	short s = argv[1];
	v = (char)(v % s);
}
void ClassChar::mod_assign_int(int argc, BValue* argv)
{
	char& v = argv[0];
	int i = argv[1];
	v = (char)(v % i);
}
void ClassChar::mod_assign_long(int argc, BValue* argv)
{
	char& v = argv[0];
	long long l = argv[1];
	v = (char)(v % (int)l);
}
void ClassChar::mod_assign_real(int argc, BValue* argv)
{
	char& v = argv[0];
	BReal r = argv[1];
	v = (char)(v % (int)r);
}
void ClassChar::mod_assign_float(int argc, BValue* argv)
{
	char& v = argv[0];
	float f = argv[1];
	v = (char)(v % (int)f);
}
void ClassChar::mod_assign_double(int argc, BValue* argv)
{
	char& v = argv[0];
	double d = argv[1];
	v = (char)(v % (int)d);
}

void ClassChar::equal_bool(int argc, BValue* argv)
{
	char v = argv[0];
	bool b = argv[1];
	argv[0] = ((bool)v == b);
}
void ClassChar::equal_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v == c);
}
void ClassChar::equal_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v == s);
}
void ClassChar::equal_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v == i);
}
void ClassChar::equal_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v == l);
}
void ClassChar::equal_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v == r);
}
void ClassChar::equal_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v == f);
}
void ClassChar::equal_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v == d);
}

void ClassChar::unequal_bool(int argc, BValue* argv)
{
	char v = argv[0];
	bool b = argv[1];
	argv[0] = ((bool)v != b);
}
void ClassChar::unequal_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v != c);
}
void ClassChar::unequal_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v != s);
}
void ClassChar::unequal_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v != i);
}
void ClassChar::unequal_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v != l);
}
void ClassChar::unequal_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v != r);
}
void ClassChar::unequal_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v != f);
}
void ClassChar::unequal_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v != d);
}

void ClassChar::greater_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v > c);
}
void ClassChar::greater_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v > s);
}
void ClassChar::greater_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v > i);
}
void ClassChar::greater_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v > l);
}
void ClassChar::greater_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v > r);
}
void ClassChar::greater_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v > f);
}
void ClassChar::greater_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v > d);
}

void ClassChar::less_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v < c);
}
void ClassChar::less_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v < s);
}
void ClassChar::less_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v < i);
}
void ClassChar::less_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v < l);
}
void ClassChar::less_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v < r);
}
void ClassChar::less_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v < f);
}
void ClassChar::less_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v < d);
}

void ClassChar::greater_equal_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v >= c);
}
void ClassChar::greater_equal_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v >= s);
}
void ClassChar::greater_equal_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v >= i);
}
void ClassChar::greater_equal_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v >= l);
}
void ClassChar::greater_equal_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v >= r);
}
void ClassChar::greater_equal_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v >= f);
}
void ClassChar::greater_equal_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v >= d);
}

void ClassChar::less_equal_char(int argc, BValue* argv)
{
	char v = argv[0];
	char c = argv[1];
	argv[0] = (v <= c);
}
void ClassChar::less_equal_short(int argc, BValue* argv)
{
	char v = argv[0];
	short s = argv[1];
	argv[0] = (v <= s);
}
void ClassChar::less_equal_int(int argc, BValue* argv)
{
	char v = argv[0];
	int i = argv[1];
	argv[0] = (v <= i);
}
void ClassChar::less_equal_long(int argc, BValue* argv)
{
	char v = argv[0];
	long long l = argv[1];
	argv[0] = (v <= l);
}
void ClassChar::less_equal_real(int argc, BValue* argv)
{
	char v = argv[0];
	BReal r = argv[1];
	argv[0] = (v <= r);
}
void ClassChar::less_equal_float(int argc, BValue* argv)
{
	char v = argv[0];
	float f = argv[1];
	argv[0] = (v <= f);
}
void ClassChar::less_equal_double(int argc, BValue* argv)
{
	char v = argv[0];
	double d = argv[1];
	argv[0] = (v <= d);
}
